<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%
    String id = request.getParameter("id");
%>
<html>
<head>
    <script type="text/javascript">
        var orderTime = $("#orderTime").val()
        var listUrl = "order/dailyFlowInfo.do?id=" + <%=id%> +"&orderTime=" + orderTime;
        $(document).ready(function() {
        $("#dailyFlowDetails-dg").datagrid({
            loadMsg : '数据加载中....',
            width : '100%',
            url : listUrl,
            nowrap : false,
            striped : true,
            sortOrder : 'desc',
            remoteSort : false,
            pageSize: 20,
            rownumbers : true,
            pagination : true,
            pageList : [ 10, 15, 20, 25 ],
            fitColumns : true,
            frozenColumns : [ [ {
                field : 'id',
                checkbox : true
            }] ],
            columns : [ [
                {
                    field : 'orderTime',
                    title : '时间',
                    width : 70,
                    formatter : function(val) {
                        return val.split(" ")[1];
                    }
                },
                {
                    field : 'orderNo',
                    title : '订单号',
                    width : 200
                },
                {
                    field : 'orderDetail',
                    title : '订单详情',
                    width : 300
                },
                {
                    field : 'orderMoney',
                    title : '订单总金额',
                    width : 50
                },
                {
                    field : 'couponDeduction',
                    title : '优惠券抵扣',
                    width : 50
                },
                {
                    field : 'platformPartion',
                    title : '平台分成',
                    width : 50
                },
                {
                    field : 'sumIncome',
                    title : '合计收入',
                    width : 50
                },
                {
                    field : 'platformProfit',
                    title : '平台盈亏',
                    width : 50
                },
                {
                    field : 'orderStatus',
                    title : '订单状态',
                    width : 100,
                    formatter : function(val){
                        return orderStatus(val);
                    }
                },
                {
                    field : 'refundDetail',
                    title : '退款说明',
                    width : 300
                }
            ] ]
        });// end datagrid
            //设置分页控件
            var p = $('#dailyFlowDetails-dg').datagrid('getPager');
            $(p).pagination(
                {
                    pageSize : 20,//每页显示的记录条数，默认为10
                    pageList : [ 20, 25 ],//可以设置每页记录条数的列表
                    beforePageText : '第',//页数文本框前显示的汉字
                    afterPageText : '页    共 {pages} 页',
                    displayMsg : '当前显示 {from} - {to} 条记录   共 {total} 条记录',
                    onBeforeRefresh : function() {
                        $(this).pagination('loading');
                        $(this).pagination('loaded');
                    }
                });//end pagination

        }); //end ready

        function exportDailyFlowDetails(){
            var pageIndex = $(".pagination-num").val();
            var pageSize = $(".pagination-page-list  option:selected").text();
            var url = "order/exportDailyFlowDetails.do?id=" + <%=id%> + "&pageIndex=" + pageIndex + "&pageSize="+pageSize + "&orderTime=" + orderTime;
            window.open(url);
        }

    </script>
</head>
<body>
<div class="linkbar"><a>店铺管理</a>/<a>店铺信息</a>/<a>每日流水详情</a></div>
<div class="formtoolbar">
</div>
</div>
<div class="clear"></div>
<div id="dailyFlowDetails-dg" toolbar="#toolbar"></div>
<div id="toolbar">
<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="exportDailyFlowDetails()">导出</a>
</div>
<input type="hidden" value="${orderTime}" id="orderTime">
<div id="dlg-buttons">
    <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="listback('shop/index.do')">返回</a>

</div>
</body>
</html>